#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QDateTime>
#include <QPainter>
#include <vector>
#include <QMainWindow>
#include "RadarController.h"
#include "Tools.h"
#include "showradar.h"
#include "Radar.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

//设置雷达显示框的宽高以及远点的位置
const int kRectangleHigh=700;
const int kRectangleWidth=1200;
const int kRoundDiameter=700-75;

const QPoint CenterCircle=QPoint((kRectangleWidth - kRoundDiameter) / 2 + kRoundDiameter / 2,
                                 (kRectangleHigh - kRoundDiameter) / 2 +
                                     kRoundDiameter / 2);//雷达圆心坐标

static QColor background_color(0,0,0);



class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void on_pushButton_setParm_clicked();
    void on_pushButton_getParm_clicked();
    void on_pushButton_getRtk_clicked();
    void on_pushButton_run_clicked();
    void on_action_triggered();
    void on_set_triggered();

//绘制方法
    void on_pushButton_14_clicked();

    void on_pushButton_clicked();

    void on_button_clearScreen_clicked();

    void on_button_ipClearScreen_clicked();

public:
    //绘制测量值
    void plotMeasurements(QPainter&painter, const std::vector<MeasurementPackage> &measurement_pack_list);
    //画可靠航迹信息
    void plotTrustTracks(QPainter &painter,
                         const std::vector<TrustTrackPackage> &trust_track_pack_list);

    //画航迹信息
    void plotTracks(
        QPainter &painter,
        const std::vector<TrackDataOutputPackage> &track_data_output_pack_list);
protected:
    void paintEvent(QPaintEvent *event) override;  //重写绘制事件
private:
    Ui::MainWindow *ui;
    Tools tools1;          //工具类
    RadarController *m_radarController=nullptr;
    Radar*m_radar=nullptr;

    /*******************************************************************************/
     std::vector<TrackDataOutputPackage> m_track_data_output_pack_list;
    //const vector<TrackDataOutputPackage> &track_data_output_pack_list
   //std::vector<TrackDataOutputPackage> &track_data_output_pack_list);


};
#endif // MAINWINDOW_H
